import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '@/views/index.vue'
import Layout from '@/views/layout.vue'
import Detail from '@/views/detail.vue'
import Map from '@/views/map.vue'
const Info = () => import('@/views/info.vue')
const User = () => import('@/views/user.vue')
const Findhouse = () => import('@/views/findhouse.vue')
const City = () => import('@/views/city.vue')
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/index',
    children: [
      { path: '/index', component: Index },
      { path: '/info', component: Info },
      { path: '/user', component: User },
      { path: '/findhouse', component: Findhouse }
    ]
  },
  { path: '/city', component: City },
  { path: '/detail', component: Detail },
  { path: '/map', component: Map }
]

const router = new VueRouter({
  routes
})

export default router
